project(FooHelper)
cmake_minimum_required(VERSION 3.13)
set(CMAKE_AUTOMOC ON)
#启用c++11标准
set(CMAKE_CXX_STANDARD 11)
set(QT_MIN_VERSION "5.11.0")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
   message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.")
endif()

find_package(Qt5 COMPONENTS Widgets DBus REQUIRED)
find_package(PolkitQt5-1)
find_package(Qt5DBus)
find_package(Qt5DBus)

include(FeatureSummary)
#服务端
set(fooHelper_SRCS
    service/dbus_adaptor.cpp
    service/foohelper.cpp
    service/policykithelper.cpp
    service/dbus_adaptor.h
    service/foohelper.h
    service/policykithelper.h

    )
add_executable(${PROJECT_NAME} "service/main.cpp" ${fooHelper_SRCS})
target_link_libraries(
    FooHelper
    Qt5::Widgets
    Qt5::DBus
    PolkitQt5-1::Agent
    )

#客户端
set(SOURCE_FILE
    client/mainwindow.cpp
    client/mainwindow.h
    client/main.cpp
    client/main.h
    client/dbus_install_deb_interface.h
    client/dbus_install_deb_interface.cpp
    )
add_executable(polkit-qt-example ${SOURCE_FILE})
target_link_libraries(
    polkit-qt-example
    Qt5::Widgets
    Qt5::DBus
    )
